////////////////////////////////////////////////////////////////
// filename: game.h
// description: header file for the game engine class
// autor: Jay Tomten (jaytomten@gmail.com)
// notes:

// namespace

// defines
#ifndef __GAME__
#define __GAME__

#define GAME_LOADING              454
#define GAME_MAIN_MENU            450
#define GAME_LEVEL_MENU           461
#define GAME_CLOSING              460

#define GAME_SINGLE_PLAYER        451
#define GAME_STORY                462
#define GAME_MULTI_PLAYER_LOCAL   452
#define GAME_MULTI_PLAYER_NET     453

#define GAME_SINGLE_WIN           455
#define GAME_SINGLE_LOSE          456
#define GAME_SINGLE_TOTAL_VICTORY 459

#define GAME_MULTI_LOCAL_P1_WIN   457
#define GAME_MULTI_LOCAL_P2_WIN   458

// includes
#include "input.h"
#include "timer.h"
#include "list.h"
#include "level.h"
#include "sound.h"

// globals

////////////////////////////////////////////////////////////////
// Game - our main game engine class
class Game {

public:

    struct Screen {          // our screen settings
        int   width;
        int   height;
        int   bpp;
        int   refresh;
        int   fullscreen;
        float maxFPS;
        int   smooth;
    };

    struct Scores {
        string name;
        int score;
    };

    SDL_Surface *screen;     // the actual screen surface!

    int       state;         // current state of game (main menu, single player, multi-player, etc)
    float     stateTimer;    // for transitions and other stuff
    bool      reload;        // do we need to (re)load a level?
    int       nextLevel;     // the next level we need to load
    int       soundFXVolume; // the sound effect volume
    int       musicVolume;   // the music volume

    Screen    gScreen;       // the screen stats
    Sound     gSound;        // the game sound
    Timer     gTime;         // our Timer class
    List     *gList;         // our list of game Objects
    Level     gLevel;        // our level class
    Input     gInput;        // input for our game
    Scores   *gScores;       // the high scores for the game

    Game();                  // constructor
    ~Game();                 // destructor

    bool Init();             // initializaion function
    bool Update(float d);    // draw function
    void Draw();             // draw all the objects to the screen
    void Exit();             // exit function

private:

    void ReadConfig();       // read and write config files
    void WriteConfig();      // write the config file (on exit)

};

#endif
